<template>
  <a-layout style="min-height: 100vh">
    <a-layout-sider v-model:collapsed="collapsed" collapsible>
      <div class="logo">
        <div class="logo-img">

        </div>
        <div class="logo-text">
          Vue-Admin
        </div>
      </div>
      <a-menu v-model:selectedKeys="selectedKeys" theme="dark" mode="inline">
        <a-menu-item key="1">
          <pie-chart-outlined />
          <span>Option 1</span>
        </a-menu-item>
        <a-menu-item key="2">
          <desktop-outlined />
          <span>Option 2</span>
        </a-menu-item>
        <a-sub-menu key="sub1">
          <template #title>
            <span>
              <user-outlined />
              <span>User</span>
            </span>
          </template>
          <a-menu-item key="3">Tom</a-menu-item>
          <a-menu-item key="4">Bill</a-menu-item>
          <a-menu-item key="5">Alex</a-menu-item>
        </a-sub-menu>
        <a-sub-menu key="sub2">
          <template #title>
            <span>
              <team-outlined />
              <span>Team</span>
            </span>
          </template>
          <a-menu-item key="6">Team 1</a-menu-item>
          <a-menu-item key="8">Team 2</a-menu-item>
        </a-sub-menu>
        <a-menu-item key="9">
          <file-outlined />
          <span>File</span>
        </a-menu-item>
      </a-menu>
    </a-layout-sider>
    <a-layout>
      <a-layout-header class="header">
        <div id="head-left">
          <HomeFilled :style="{ fontSize: '26px' }" id="home-icon" />
          <div id="head-text">首页</div>
        </div>
        <LogoutOutlined :style="{ fontSize: '22px' }" id="logout-icon" />
        <!-- <Icon></Icon> -->
      </a-layout-header>
      <a-layout-content style="margin: 20px 16px">
        <div :style="{ padding: '24px', background: '#fff', minHeight: '360px' }">
          <router-view></router-view>
        </div>
      </a-layout-content>
      <a-layout-footer style="text-align: center">
        Copy right of u self ©2018
      </a-layout-footer>
    </a-layout>
  </a-layout>
</template>

<script setup>
import {
  PieChartOutlined,
  DesktopOutlined,
  UserOutlined,
  TeamOutlined,
  FileOutlined,
  // MenuUnfoldOutlined,
  // MenuFoldOutlined,
  HomeFilled,
  LogoutOutlined
} from '@ant-design/icons-vue';
import { ref } from 'vue';
const collapsed = ref(false);
const selectedKeys = ref(['1']);
</script>

<script>
export default {
  name: 'HelloWorld',
  props: {
    msg: String
  }
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped lang="scss">
h3 {
  margin: 40px 0 0;
}

ul {
  list-style-type: none;
  padding: 0;
}

li {
  display: inline-block;
  margin: 0 10px;
}

a {
  color: #42b983;
}

.logo {
  width: 80%;
  aspect-ratio: 4/1;
  margin: 10px auto;
  display: flex;
  align-items: center;
}

.logo-img {
  height: 80%;
  aspect-ratio: 1/1;
  background-color: #fff;
  flex: 1;
  border-radius: 20%;
}

.logo-text {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 5;
  font-size: 20px;
  color: rgba(255, 255, 255, 0.521);
  font-weight: bold;
}

.header {
  background-color: white;
  display: flex;
  flex-direction: row;
  padding: 0px;
  align-items: center;
}

#head-left {
  display: flex;
  flex-direction: row;
  align-items: center;
}

#home-icon {
  margin-left: 20px;
  margin-right: 20px;
  flex: 1;
}

#head-text {
  font-size: 18px;
  flex: 3
}

#logout-icon {
  flex: 10;
  display: flex;
  justify-content: end;
  padding-right: 30px;
}
</style>
